<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: magic_new.php 6752 2010-03-25 08:47:54Z cnteacher $
 */

if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}

$getmagicdata = $magicperm['presentcontent'];

if(submitcheck('usesubmit')) {

	foreach($getmagicdata as $getmagicid => $magicdata) {
		$totalweight = $magicdata['num'] * $magicdata['weight'];
		getmagic($getmagicid, $magicdata['num'], $magicdata['weight'], $totalweight, $_G['uid'], 0, 1);
	}

	usemagic($magicid, $magic['num']);
	updatemagiclog($magicid, '2', '1', '0', $_G['tid']);
	updatemagicthreadlog($_G['tid'], $magicid, $magic['identifier']);
	showmessage('magics_operation_succeed', '', array('succeed' => 1));

}

function showmagic() {
	global $lang;
	magicshowtips($lang['NEW_info'], $lang['option']);
}

?>